#ifndef PLAYER_H
#define PLAYER_H

//STATE!

//Player definitions (position...)

#include "Util.h"
#include "MobileObject.h"

enum PlayerType
{
    GOALIE,
    PLAYER
};

class Player : public MobileObject
{
    int side;
    int uNum;
    int playerType;
    double bodyDir;

public:
    static Player & instance();
    void move(double X, double Y);

    void setSide(int side) { this->side = side; }
    int getSide() { return side; }

    void setuNum(int uNum) { this->uNum = uNum; }
    int getuNum() { return uNum; }

    void setPlayerType(int playerType) { this->playerType = playerType; }
    int getPlayerType() { return playerType; }

    void setBodyDir(double bodyDir) { this->bodyDir = bodyDir; }
    double getBodyDir() { return bodyDir; }


    //helpers!

    double angleFromBody(Vector v)
    {
        AngleDeg angle = position.directionOf(v) - bodyDir;
        NormalizeAngleDeg(angle);
        return angle;
    }

    double angleFromBody(MobileObject o) { return angleFromBody(o.getPosition()); }

    double dist(MobileObject o) { return position.Dist(o.getPosition()); }
};

#endif // PLAYER_H
